package com.ruoyi.web.controller.cs;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.cs.domain.vo.FXPayNotifyParam;
import com.ruoyi.cs.service.ICHPayService;
import com.ruoyi.cs.service.IFUXINPayService;
import io.swagger.annotations.Api;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


/**
 * 富信充值
 *
 * @author ruoyi
 * @date 2021-03-25
 */
@RestController
@RequestMapping("/cs/fxpay")
@Api(tags = {"富信充值记录管理"})
public class FXPayController {
    private static final Logger log = LoggerFactory.getLogger(FXPayController.class);

    @Autowired
    private IFUXINPayService ifuxinPayService;

    @PostMapping("/fxPayNotify")
    @Log(title = "富信充值异步回调", businessType = BusinessType.OTHER)
    public void fxPayNotify(@RequestBody FXPayNotifyParam fxPayNotifyParam) {
        try {
            ifuxinPayService.notify(fxPayNotifyParam);
        } catch (Exception e) {
            log.error("富信支付异步通知异常:{},参数:{}", e.getMessage());
        }
    }
}
